<template>
  <div>
    <a-form style="max-width: 500px; margin: 40px auto 0;">
      <a-alert
          :closable="true"
          :message="$t('note')"
          style="margin-bottom: 24px;"
      />
      <a-form-item
          :label="$t('payment')"
          :labelCol="{span: 7}"
          :wrapperCol="{span: 17}"
          class="stepFormText"
      >
        {{ project.projectName }}
      </a-form-item>
      <a-form-item
          :label="$t('collection')"
          :labelCol="{span: 7}"
          :wrapperCol="{span: 17}"
          class="stepFormText"
      >
        {{ project.projectClassId }}
      </a-form-item>
      <a-form-item
          :label="$t('collectionName')"
          :labelCol="{span: 7}"
          :wrapperCol="{span: 17}"
          class="stepFormText"
      >
        {{ project.projectTip }}
      </a-form-item>
      <a-form-item
          :label="$t('transferAmount')"
          :labelCol="{span: 7}"
          :wrapperCol="{span: 17}"
          class="stepFormText"
      >
        {{ project.projectReasion }}
      </a-form-item>
      <a-form-item
          label="项目详情"
          :labelCol="{span: 7}"
          :wrapperCol="{span: 17}"
          class="stepFormText"
      >
        {{ project.projectContent }}
      </a-form-item>
      <a-form-item
          label="参选公司"
          :labelCol="{span: 7}"
          :wrapperCol="{span: 17}"
          class="stepFormText"
      >
        {{ project.company.company_name }}
      </a-form-item>
      <a-form-item
          label="申报人"
          :labelCol="{span: 7}"
          :wrapperCol="{span: 17}"
          class="stepFormText"
      >
        {{ project.declarant.user_name }}
      </a-form-item>
      <a-form-item
          label="申报时间"
          :labelCol="{span: 7}"
          :wrapperCol="{span: 17}"
          class="stepFormText"
      >
        {{ new Date().toLocaleString() }}
      </a-form-item>
      <a-form-item :wrapperCol="{span: 17, offset: 7}">
        <a-button :loading="loading" type="primary" @click="nextStep">{{$t('submit')}}</a-button>
        <a-button style="margin-left: 8px" @click="prevStep">{{$t('preStep')}}</a-button>
      </a-form-item>
    </a-form>
  </div>
</template>

<script>
export default {
  name: 'Step2',
  i18n: require('./i18n'),
  props: {
    project: Object
  },
  data () {
    return {
      url: this.$store.state.apiUrl + ':' + this.$store.state.apiPort,
      loading: false,
    }
  },
  methods: {
    nextStep () {
      let _this = this
      _this.loading = true
      this.$emit('submit')
      setTimeout(function () {
        _this.$emit('nextStep')
      }, 1500)
    },
    // 跳转到上一步
    prevStep () {
      this.$emit('prevStep')
    }
  }
}
</script>

<style lang="less" scoped>
.stepFormText {
  margin-bottom: 24px;
  :global {
    .ant-form-item-label,
    .ant-form-item-control {
      line-height: 22px;
    }
  }
}
</style>
